package cn.dxs.gitee.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import cn.dxs.gitee.dao.AuthUser;
import cn.dxs.gitee.dao.LocalUser;
import cn.dxs.gitee.dao.BookMarkUser;
import cn.dxs.gitee.dao.TraceUser;

import cn.dxs.gitee.dao.AuthUserDao;
import cn.dxs.gitee.dao.LocalUserDao;
import cn.dxs.gitee.dao.BookMarkUserDao;
import cn.dxs.gitee.dao.TraceUserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig authUserDaoConfig;
    private final DaoConfig localUserDaoConfig;
    private final DaoConfig bookMarkUserDaoConfig;
    private final DaoConfig traceUserDaoConfig;

    private final AuthUserDao authUserDao;
    private final LocalUserDao localUserDao;
    private final BookMarkUserDao bookMarkUserDao;
    private final TraceUserDao traceUserDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        authUserDaoConfig = daoConfigMap.get(AuthUserDao.class).clone();
        authUserDaoConfig.initIdentityScope(type);

        localUserDaoConfig = daoConfigMap.get(LocalUserDao.class).clone();
        localUserDaoConfig.initIdentityScope(type);

        bookMarkUserDaoConfig = daoConfigMap.get(BookMarkUserDao.class).clone();
        bookMarkUserDaoConfig.initIdentityScope(type);

        traceUserDaoConfig = daoConfigMap.get(TraceUserDao.class).clone();
        traceUserDaoConfig.initIdentityScope(type);

        authUserDao = new AuthUserDao(authUserDaoConfig, this);
        localUserDao = new LocalUserDao(localUserDaoConfig, this);
        bookMarkUserDao = new BookMarkUserDao(bookMarkUserDaoConfig, this);
        traceUserDao = new TraceUserDao(traceUserDaoConfig, this);

        registerDao(AuthUser.class, authUserDao);
        registerDao(LocalUser.class, localUserDao);
        registerDao(BookMarkUser.class, bookMarkUserDao);
        registerDao(TraceUser.class, traceUserDao);
    }
    
    public void clear() {
        authUserDaoConfig.clearIdentityScope();
        localUserDaoConfig.clearIdentityScope();
        bookMarkUserDaoConfig.clearIdentityScope();
        traceUserDaoConfig.clearIdentityScope();
    }

    public AuthUserDao getAuthUserDao() {
        return authUserDao;
    }

    public LocalUserDao getLocalUserDao() {
        return localUserDao;
    }

    public BookMarkUserDao getBookMarkUserDao() {
        return bookMarkUserDao;
    }

    public TraceUserDao getTraceUserDao() {
        return traceUserDao;
    }

}
